//
//  CommentHandleView.m
//  CarLife
//
//  Created by yu on 2019/4/3.
//  Copyright © 2019年 jpas. All rights reserved.
//

#import "CommentHandleView.h"

@implementation CommentHandleView

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [[NSBundle mainBundle] loadNibNamed:@"CommentHandleView" owner:self options:nil];
        [self addSubview:self.contentView];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}

#pragma mark -

- (IBAction)commentAction:(id)sender {
    if ([self.delegate respondsToSelector:@selector(commentAction:)]) {
        [self.delegate commentAction:(UIButton *)sender];
    }
//    PPLog(@"评论");
}
- (IBAction)countAction:(id)sender {
    PPLog(@"数量");
}
- (IBAction)likeAction:(id)sender {
    PPLog(@"喜欢");
}
- (IBAction)favoriteAction:(id)sender {
    PPLog(@"收藏");
}


#pragma mark -
//- (void)setupUI {

//    _commentBtn = [[UIButton alloc] init];
//     [self addSubview:_commentBtn];
//    _commentBtn.backgroundColor = kBackGroundLightGrayColor;
//    [_commentBtn setImage:IMAGE_NAMED(@"edit") forState:UIControlStateNormal];
//    _commentBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
//    [_commentBtn setTitle:@"我来说两句..." forState:UIControlStateNormal];
//    _commentBtn.titleLabel.font = [UIFont systemFontOfSize:15];
//    [_commentBtn setTitleColor:kTextBlackColor forState:UIControlStateNormal];
//    _commentBtn.imageView.sd_layout
//    .leftSpaceToView(_commentBtn, 10)
//    .widthIs(25);
//    _commentBtn.titleLabel.sd_layout
//    .leftSpaceToView(_commentBtn.imageView, 2);
//
//    _commentBtn.sd_layout
//    .leftSpaceToView(self, 20)
//    .centerYEqualToView(self)
//    .widthIs(kAutoWidth(180))
//    .heightIs(kAutoHeight(32));
//    _commentBtn.sd_cornerRadius = @(_commentBtn.sd_height/2);
//
//    UIView *containerView = [[UIView alloc] init];
//    [self addSubview:containerView];
//
//    NSArray *imgs = @[@"comment_post_detail",@"like_post_detail",@"favorite"];
//    NSMutableArray *temp = [NSMutableArray array];
//
//    for (int i = 0; i < imgs.count; i++) {
//        UIButton *btn = [[UIButton alloc] init];
//        btn.backgroundColor = [UIColor orangeColor];
//        [btn setImage:IMAGE_NAMED(imgs[i]) forState:UIControlStateNormal];
//        [containerView addSubview:btn];
//        btn.sd_layout.autoHeightRatio(1);
//        [temp addObject:btn];
//    }
//
//    [containerView setupAutoWidthFlowItems:[temp copy] withPerRowItemsCount:3 verticalMargin:0 horizontalMargin:20 verticalEdgeInset:0 horizontalEdgeInset:15];
//
//    containerView.sd_layout
//    .leftSpaceToView(_commentBtn, 5)
//    .rightSpaceToView(self, 0)
//    .centerYEqualToView(_commentBtn)
//    .heightRatioToView(_commentBtn, 1);
//
//}


@end
